package com.funtl.itoken.web.admin.config;

import com.funtl.itoken.web.admin.interceptor.WebAdminIntorceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebAdminConfig implements WebMvcConfigurer {
    @Bean
    public WebAdminIntorceptor webAdminIntorceptor(){
        return new WebAdminIntorceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {


        registry.addInterceptor(webAdminIntorceptor()).addPathPatterns("/**")
                .excludePathPatterns("/static");
    }
}
